package com.qf.commerce.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.commerce.common.dto.WaybillDto;
import com.qf.commerce.common.vo.WaybillVo;
import com.qf.commerce.mapper.WaybillListMapper;
import com.qf.commerce.service.WaybillService;
import com.qf.commerce.utils.CommonBeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 出品人:lsj
 * 1992915043@qq
 */
@Service
public class WaybillServiceImpl implements WaybillService {
       @Autowired
    private WaybillListMapper waybillListMapper;
    @Override
    public PageInfo<WaybillVo> getPageWaybill(WaybillDto waybillDto, Integer page, Integer size) {
        //dto转vo

        return CommonBeanUtils.copyPage(PageHelper.startPage(page,size).
                doSelectPageInfo(()->waybillListMapper.selectWaybillList(waybillDto))
                ,new PageInfo<WaybillVo>(),WaybillVo::new);
    }
}
